package com.hk.quartz.config;

import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author bigbeardhk
 * @Date 2021/1/20 20:23
 * @Email bigbeardhk@163.com
 */
@RestController
@RequestMapping("/quartz")
public class TestController {

    @Autowired
    private QuartzSchedulerConfig quartzSchedulerConfig;

    @RequestMapping("/test")
    public String test(){
        try {
            quartzSchedulerConfig.startJob();
        } catch (SchedulerException e) {
            e.printStackTrace();
        }
        return " ";
    }
}
